/**
 * // Definition for a Node.
 * function Node(val,children) {
 *    this.val = val;
 *    this.children = children;
 * };
 */

/**
 * @param {Node|null} root
 * @return {number}
 */
var maxDepth = function (root) {
    let deep = 0
    if (!root) return 0
    for (let i = 0; i < root.children.length; i++) {
        deep = Math.max(maxDepth(root.children[i]), deep)
    }
    return deep+1
};